<template>
  <div :style="iconStyle" class="icon-circle">
    <SvgIcon :icon="icon" color="#fff" size="18"/>
  </div>
</template>

<script lang="ts" setup>
import { SvgIcon } from '@/components/icon';
import { computed } from 'vue';

const props = defineProps({
  icon: {
    type: String,
    default: 'example',
    required: true
  },
  background: {
    type: String,
    default: 'var(--el-color-primary)'
  }
});

const iconStyle = computed(() => {
  return {background: props.background};
});
</script>

<style lang="scss" scoped>

.icon-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  text-align: center;
  line-height: 28px;
  display: inline-block;
}
</style>
